package jmine.tec.database.query.condition;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import jmine.tec.database.query.Column;
import jmine.tec.database.query.Condition;

/**
 * Condição que indica que o campo é nulo.
 * 
 * @author lundberg
 */
public class IsNullCondition implements Condition {

    private final Column column;

    /**
     * Construtor
     * 
     * @param column column
     */
    public IsNullCondition(Column column) {
        this.column = column;
    }

    /**
     * {@inheritDoc}
     */
    public String createQueryCondition() {
        return this.column.getName() + " IS NULL";
    }

    /**
     * {@inheritDoc}
     */
    public int setParameters(PreparedStatement st, int parameterIndex) throws SQLException {
        return parameterIndex;
    }

}
